<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
    <meta name="author" content="姚德秋">
    <title></title>
    <style>
        a{
            color: inherit;
            font-size: inherit;
            text-decoration: none;
        }
        *{
            box-sizing: border-box;
        }
        .box{
            display: flex;
        }
        .box>div{
            margin-left: 10px;
            position: relative;
        }
        a{
            display: inline-block;
            width: 19px;
            height: 19px;
            background-image: url(star.png);
        }
        a.active{
            background-position: 0 -28px;
        }
        .box>div:hover .pingjia{
            display: block;
        }
        .pingjia{
            border: 1px solid red;
            font-size: 12px;
            position: absolute;
            left: 0;
            top: 20px;
            width: 120px;
            display: none;
        }
        .result{
            font-size: 20px;
           font-weight: bold;
           color: red;
        }
    </style>
</head>
<body>
    <div class="box">
        <span>宝贝与描述相符</span>
        <div>
            <a href="javascript:;"></a>
            <a href="javascript:;"></a>
            <a href="javascript:;"></a>
            <a href="javascript:;"></a>
            <a href="javascript:;"></a>
            <div class="pingjia">五星好评</div>
        </div>
        <span class="result"></span>
    </div>
    <script src="./jquery.js"></script>
</body>
</html>
<script>
    $('a').hover(function(){
            $(this).addClass('active').prevAll().addClass('active').end().nextAll().removeClass('active');
            var left = $(this).innerWidth()*($(this).index()+1)
            $('.pingjia').css('left',left).html($(this).index()+1+'星好评');
    })
        $('a').click(function(){
            $('.result').html( $(this).index()+1 +'分');
        })
</script>